﻿using System;
using System.Collections.Generic;

namespace EnterpriseFramework.DataAccess
{
    public interface IQuery
    {
        QueryResult QResult { get; }

        IQuery Where(string Criteria, params IParameter[] parameters);

        IQuery OrderBy(string OrderByExpression);

        IQuery GroupBy();

        IQuery Top(int NumOfRow);

        IQuery Distinct { get; }

        /// <summary>
        /// Used to Apply any expression on column as SUM,MAX,...
        /// Note: Column that apply this expression must precede $
        /// Note: do not forget if use any Aggregation funcation with other columns to use <c>GroupBy()</c>.
        /// </summary>
        /// <param name="Expression"></param>
        /// <param name="PropertyName">this property optional where if not use it the result not 
        /// included this column as in result of select.
        /// </param>
        /// <returns></returns>
        /// <example>
        /// .ColumnExpression("MAX($personalID)");
        /// .GroupBy();
        /// </example>
        IQuery ColumnExpression(string Expression);

        IQuery Having(string Criteria, params IParameter[] parameters);

        Dictionary<string, object> ResqultQuery { get; }

    }
}
